package javase.thread;


import java.util.*;
public class SysCalculater
{
	public static void main(String[] args) throws Exception
	{
		/*new Timer().schedule(new TimerTask(){
			public void run()
			{
				try{Runtime.getRuntime().exec("calc.exe");}
				catch(Exception e){}
				//Timer.cancel();
				//this.cancel();
				//TimerTask.cancel();
			}
		},3000);*/
		Timer tm=new Timer();
		tm.schedule(new MyTimerTask(tm),3000);
	}	
}
class MyTimerTask extends TimerTask
{
	private Timer tm=null;
	public MyTimerTask(Timer tm)
	{
		this.tm=tm;
	}
	public void run()
	{
		try{Runtime.getRuntime().exec("calc.exe");}
		catch(Exception e){}
		tm.cancel();//����Ϳ��Ե�������������������ͽ���
	}
}

